package org.numb.chapter02.election;

import org.apache.curator.framework.recipes.leader.LeaderLatch;
import org.numb.chapter02.common.ZKCliFactory;

public class LeaderLatchDemo {

    public static void main(String[] args) throws Exception {
        LeaderLatch latch = new LeaderLatch(ZKCliFactory.getZKCli(), "/leader");
        latch.start();
        System.out.println(latch.hasLeadership());
    }

}
